package com.lee.demonacosclient;

import com.lee.demonacosclient.configuration.feign.ServiceProviderFeignConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@Configuration
//代码的方式设置 feign的全局配置
//@EnableFeignClients(defaultConfiguration = ServiceProviderFeignConfiguration.class)
@EnableFeignClients
public class DemoNacosClientApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoNacosClientApplication.class, args);
	}


	@Bean
	@LoadBalanced
	public RestTemplate createRestTemplate() {
		return new RestTemplate();
	}
}
